<template>
  <div class="box">
    <header class="header">user header</header>
    <div class="content">
      <button @click="logout">退出</button>
    </div>
  </div>
</template>
<script>
export default {
  methods: {
    logout () {
      localStorage.removeItem('isLogin')
      localStorage.removeItem('userid')
      localStorage.removeItem('token')
      this.$store.commit('changeLoginState', false)
      this.$router.replace('/login')
    }
  }
}
</script>
